package sg.edu.nus.iss.jass.persistence;

import java.util.List;

import sg.edu.nus.iss.jass.datastore.BaseDAO;
import sg.edu.nus.iss.jass.datastore.exception.DataStoreException;
import sg.edu.nus.iss.jass.dto.GeographicalLocation;

public class LocationDAO extends BaseDAO {

	public void addLocation(String country, String continent) throws DataStoreException {

		GeographicalLocation location = new GeographicalLocation();
		location.setContinent(continent);
		location.setCountry(country);
		save(location);
	}
	
	public List<GeographicalLocation> getAllLocations() throws DataStoreException{
		return selectAll(GeographicalLocation.class);
	}
	
	public GeographicalLocation getLocationById(String locationId) throws DataStoreException {
		return selectById(GeographicalLocation.class, locationId);
	}
}
